<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    var reverseString = function (s) {
      let start = 0;
      let end = s.length - 1;
      while (start < end) {
        [s[start], s[end]] = [s[end], s[start]];
        start++;
        end--;
      }
      return s;
    };
    console.log(reverseString(s = ["h", "e", "l", "l", "o"]))
  </script>
</body>

</html>